package com.hbx.residential_service.domain;

import com.hbx.residential_service.utils.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Complaint {
    private int cpId;
    private String cpTitle;
    private String cpContent;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date cpDate;
    private String cpDateStr;
    private Integer cpStatus;
    private String cpStatusStr;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date cpHandleDate;
    private String cpHandleDateStr;
    private User user;
    private Admin admin;

    public int getCpId() {
        return cpId;
    }

    public void setCpId(int cpId) {
        this.cpId = cpId;
    }

    public String getCpTitle() {
        return cpTitle;
    }

    public void setCpTitle(String cpTitle) {
        this.cpTitle = cpTitle;
    }

    public String getCpContent() {
        return cpContent;
    }

    public void setCpContent(String cpContent) {
        this.cpContent = cpContent;
    }

    public Date getCpDate() {
        return cpDate;
    }

    public void setCpDate(Date cpDate) {
        this.cpDate = cpDate;
    }

    public String getCpDateStr() {
        if(cpDate!=null){
            cpDateStr= DateUtils.DateToString(cpDate,"yyyy-MM-dd");
        }
        return cpDateStr;
    }

    public void setCpDateStr(String cpDateStr) {
        this.cpDateStr = cpDateStr;
    }

    public Integer getCpStatus() {
        return cpStatus;
    }

    public void setCpStatus(Integer cpStatus) {
        this.cpStatus = cpStatus;
    }

    public String getCpStatusStr() {
        if(cpStatus!=null){
            if(cpStatus==0)cpStatusStr="未处理";
            if(cpStatus==1)cpStatusStr="已处理";
        }
        return cpStatusStr;
    }

    public void setCpStatusStr(String cpStatusStr) {
        this.cpStatusStr = cpStatusStr;
    }

    public Date getCpHandleDate() {
        return cpHandleDate;
    }

    public void setCpHandleDate(Date cpHandleDate) {
        this.cpHandleDate = cpHandleDate;
    }

    public String getCpHandleDateStr() {
        if(cpHandleDate!=null){
            cpHandleDateStr= DateUtils.DateToString(cpHandleDate,"yyyy-MM-dd");
        }
        return cpHandleDateStr;
    }

    public void setCpHandleDateStr(String cpHandleDateStr) {
        this.cpHandleDateStr = cpHandleDateStr;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Admin getAdmin() {
        return admin;
    }

    public void setAdmin(Admin admin) {
        this.admin = admin;
    }
}
